package realQuestion.zhongXin;

import com.sun.deploy.uitoolkit.impl.fx.AppletStageManager;

import java.util.Arrays;
import java.util.Scanner;

public class Main1 {
      static  int[][] nums;
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
       nums =new int[n][n];
        for (int i= 0; i <n ; i++) {
            for (int j = 0; j < n; j++) {
                nums[i][j]=scanner.nextInt();
            }
        }
        reverse(nums);
        for (int i = 0; i < n; i++) {
//            for (int a:
//                 nums[i]) {
//                System.out.print(a);
//                System.out.print(" ");
//            }

            for (int j = 0; j < n; j++) {
                if (j==n-1){
                    System.out.print(nums[i][j]+"\n");
                }else {
                    System.out.print(nums[i][j]);
                    System.out.print(" ");
                }
            }
//            System.out.println(Arrays.asList(nums[i]).toString());

        }
//        System.out.println(nums.toString());

    }
    public  static  void    reverse(int[][] nums){
        int len = nums.length;
//
        int lo=0;
        int hi=len-1;
        while (lo<hi){
            int[] temp=nums[lo];
            nums[lo]=nums[hi];
            nums[hi]=temp;
            lo++;
            hi--;
        }

        for (int i = 0; i < len; i++) {
            int lo1=0;
            int hi1=len-1;
            while (lo1<hi1){
                int temp1=nums[i][lo1];
              nums[i][lo1]=nums[i][hi1];
              nums[i][hi1]=temp1;
              lo1++;
              hi1--;
            }

        }


    }

}
